package com.zs4sdk.entity;


import com.common.library.entity.JSONResultEntity;
import com.common.library.util.Helper;

import org.json.JSONException;
import org.json.JSONObject;

/**
 * Created by Jancy on 16/2/15.
 */
public class VerifyIdCardInfoEntity extends JSONResultEntity {
    public static final String CLOMU_ID_NUMBER = "id_number";
    public static final String CLOMU_ID_NAME = "name";

    private String id_number;
    private String name;

    /**
     * 构造方法
     * @param json
     */
    public VerifyIdCardInfoEntity(JSONObject json){
        this.fromJSON(json);
    }

    //#region Override方法
    @Override
    public JSONObject toJSON() {
        JSONObject result = super.toJSON();
        try {
            result.put(CLOMU_ID_NUMBER, this.id_number);
            result.put(CLOMU_ID_NAME, this.name);
        } catch (JSONException e) {
            e.printStackTrace();
        }
        return result;
    }

    @Override
    public void fromJSON(JSONObject json) {
        super.fromJSON(json);
        if (Helper.isNotEmpty(json)) {
            this.id_number = json.optString(CLOMU_ID_NUMBER);
            this.name = json.optString(CLOMU_ID_NAME);
        }
    }

    public String getId_number() {
        return id_number;
    }

    public void setId_number(String id_number) {
        this.id_number = id_number;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
